package priorityqueue;

import java.util.PriorityQueue;

//PriorityQueue接口
public class Test1 {
    public static void main(String[] args) {
        PriorityQueue<Integer> queue = new PriorityQueue<>();
        //默认的比较规则是从小到大
        queue.offer(3);
        queue.offer(1);
        queue.offer(2);
        queue.offer(4);
        while(!queue.isEmpty()){
            System.out.println(queue.poll());
        }



    }
}
